package com.maolong.spring.beans.factory.support;

import com.maolong.spring.beans.factory.config.SingletonBeanRegistry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {
    Map<String,Object> stringObjectMap=new ConcurrentHashMap<>();

    @Override
    public Object getSingleton(String beanName) {
        return stringObjectMap.get(beanName);
    }

    protected void addSingleton(String beanName,Object bean)
    {
        stringObjectMap.put(beanName,bean);
    }

}
